package com.gxa.luckin.order.repository;

import com.gxa.luckin.order.pojo.Order;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @author: XHZ
 * @date: 15:46 2021/7/16
 */
public interface OrderRepository extends JpaRepository<Order, String> {
    Order findOrderByOrderId(String id);

    @Query(nativeQuery = true,value="select * from luckin_order where user_id=?1")
    List<Order> queryAllByUserId(Long userId);
}
